<!DOCTYPE html>
<%@page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="/tld/authority.tld" prefix="authority" %>
<%@taglib uri="/tld/token.tld" prefix="token" %>

<div class="pop-background">
    <div class="col-md-4">
        <div class="popup popup5 popup-small x-4-move">
            <div class="panel-heading">
                <div class="panel-btns">
                    <a class="panel-close btn-4-hide">×</a>
                </div>
                <h3 class="panel-title">${empty options.id ? '新增选项值' : '修改选项值'}</h3>
            </div>
            <div class="panel-add-to">
                <form>
                    <token:token/>
                    <input type="hidden" name="id" value="${options.id}">

                    <div class="row">
                        <div class="panel-body panel-body-ws">

                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">
                                        <em class="color-red btian">*</em>选项名称：
                                    </label>

                                    <div class="col-sm-6">
                                        <div class="select-container select">
                                            <c:choose>
                                                <c:when test="${empty options.id}">
                                                    <select class="select select-offscreen" name="k">
                                                        <option value="">-请选择-</option>
                                                        <c:forEach items="${optionsKeyList}" var="item">
                                                            <option value="${item.k}" ${item.k == options.k ? 'selected' : ''}>${item.name}</option>
                                                        </c:forEach>
                                                    </select>
                                                </c:when>
                                                <c:otherwise>
                                                    <input type="text" class="form-control" value="${options.keyName}" readonly />
                                                    <input type="hidden" name="k" value="${options.k}" readonly />
                                                </c:otherwise>
                                            </c:choose>

                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><em
                                            class="color-red btian">*</em>选项值：</label>

                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" name="val"
                                               value="${options.val}">
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><em
                                            class="color-red btian">*</em>显示文本：</label>

                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" name="txt"
                                               value="${options.txt}">
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">排序：</label>

                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" name="seq"
                                               value="${options.seq}">
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>

                    <div class="btn-group2-s">
                        <div class="panel-body panel-body2">
                            <div class="btn-group2 left ">
                                <authority:authority url="/options/add,/options/modify">
                                    <button type="button" class="btn btn-primary btn-4-save">保存</button>
                                </authority:authority>
                                <button type="button" class="btn btn-default btn-4-hide">取消</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="js/dictionary/options-edit.js"></script>
</div>